package com.terrynoya.fight.commands
{
	public class BufferCount
	{
		private var _value:int;
		private var _isActive:Boolean;
		
		public function BufferCount()
		{
			
		}
		
		public function get isActive():Boolean
		{
			return _isActive;
		}

		public function reset():void
		{
			this._value = 0;
			this._isActive = false;
		}
		
		public function setTime(time:int):void
		{
			this._value = Math.max(this._value,time);
			this._isActive = this._value > 0;
		}
		
		public function tick():void
		{
			this._value = Math.max(0, this._value - 1);
			this._isActive = this._value > 0;
		}
	}
}